]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
network: Close Wifi selection dialog when appropriate
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 14 Mar 2017 19:32:50 +0000 (20:32 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Mon, 20 Mar 2017 18:02:07 +0000 (19:02 +0100)
Currently when the wifi selection dialog is open when the screen lock is
activated, the dialog remains visible above the shield. This is clearly
broken, so close the dialog automatically on session mode changes if the
mode doesn't allow settings (as changing the access point is arguably a
user setting).

https://bugzilla.gnome.org/show_bug.cgi?id=780054

js/ui/status/network.js

index bedfc5e384cbe7ded6abeea851f0827d952c93d7..4f23fd3bc1b53bea1ee6cbfc462422c06b018c61 100644 (file)
@@ -769,6 +769,14 @@ const NMWirelessDialog = new Lang.Class({
         this._scanTimeoutId = Mainloop.timeout_add_seconds(15, Lang.bind(this, this._onScanTimeout));
         GLib.Source.set_name_by_id(this._scanTimeoutId, '[gnome-shell] this._onScanTimeout');
         this._onScanTimeout();
+
+        let id = Main.sessionMode.connect('updated', () => {
+            if (Main.sessionMode.allowSettings)
+                return;
+
+            Main.sessionMode.disconnect(id);
+            this.close();
+        });
     },
 
     destroy: function() {